<?
	class Item 
	{
		var $data;
	
		function __construct($item_data)
		{
			$url = 'http://us.battle.net/api/d3/data/' . $item_data;
			
			$data = json_decode(file_get_contents($url));
			
			$this->data = $data;		
		}
		
		function __get($name)
		{
			return $this->data->$name;
		}
	}
	
	if($_GET['item_data'])
	{
		//header('Content-type: application/json');
		$item = new Item($_GET['item_data']);
		echo json_encode($item->data);
	}
?>